<?php


require "database.php";


$base=new Db;


$______res_______=$base->doSql('select * from hkcms_admin where status="normal" order by id asc');


for ($i = 0; $i < count($______res_______); $i++) {
    $_____auth_____=$base->doSql('select * from hkcms_auth_group_access where admin_id="'.$______res_______[$i]["id"].'" ');
    $_____auth_group_id____=$_____auth_____[0]["group_id"];
    
    $_____hkcms_auth_group______=$base->doSql('select * from hkcms_auth_group where id="'.$_____auth_group_id____.'"');
    $______res_______[$i]["group_names"]=$_____hkcms_auth_group______[0]["name"];
}



// for ($i = 0; $i < count($______res_______); $i++) {
//     $______res_______[$i]["spacer"]="&nbsp;└";//&nbsp;└
//     $______res_______[$i]["name"]=$______res_______[$i]["spacer"].$______res_______[$i]["name"];
    
//     if($______res_______[$i]["parent_id"]==0){
//         $______res_______[$i]["haschild"]=1;
//     }else{
//         $______res_______[$i]["haschild"]=0;
//     }
// }


$data=[
    "total" =>count($______res_______),   
    "rows"  =>$______res_______
];


return json($data);